<?php

namespace pmvc;

/**
 * Interface for class loading.
 */
interface ClassLoader {

	/**
	 * Requires the given file.
	 * 
	 * @param string $file the file to require
	 * @return bool false if the file wasn't found, any
	 * 	other value if it was found.
	 */
	function requireFile($file, $once=false);

	/**
	 * Returns all resource paths for the given
	 * path with optional recursiveness.
	 * 
	 * @param string $file the path
	 * @param bool $recursive whether or not to be recursive
	 * @return array of resource paths
	 */
	function getResourcePaths($file, $recursive=true);

	/**
	 * Returns the path to the given file
	 * that must exist in the classpath.
	 * 
	 * @param string $file the file to map
	 * @return string the file name, or false if it wasn't found
	 */
	function getResourcePath($file);

	/**
	 * Returns a {@link pmvc\io\Stream} to the given file
	 * found in the classpath.  false
	 * is returned if the ClassLoader is unable
	 * to locate the given file.
	 * 
	 * @param string $file the file
	 * @return {@link pmvc\io\Stream} or false if not found
	 */
	function getResourceAsStream($file);

	/**
	 * Loads the given class.
	 * 
	 * @param $className the class to load
	 * @return true if the class was found and loaded, false otherwise
	 */
	function loadClass($className);
	
}

?>